package com.itheima.thread;
/*
守护线程
 */
public class Demo08 {

    public static void main(String[] args) {

        Thread t = new Thread(() -> {
            for (int i = 0; i < 100; i++) {
                System.out.println(Thread.currentThread().getName()+"执行到了"+i);
            }
        });
        t.setName("我是备胎我骄傲");
        t.setDaemon(true);//我变成 了main的备胎
        t.start();
        for (int i = 0; i < 10; i++) {
            System.out.println(Thread.currentThread().getName()+"执行到了"+i);
        }


    }
}
